<!-- 
Copyright (c) Guangzhou Data Control Network Technology Co., Ltd. All rights reserved. 
Licensed under the MIT License.
contact:dcdev_founder@foxmail.com 
-->


<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <!-- 数控开发基础样式库（已作一定的自适应，button/label/input/textarea等设置了默认样式） -->
    <link class="_dcdev_preset_" type="text/css" rel="stylesheet"
        href="https://res.dcdev.net/dcdev/v1.0.6/assets/css/dcdevui.css">
    <!-- 页面标题 -->
    <title>数控开发 · 预览代码片段</title>

    <!-- 桌面端浏览器及收藏夹图标 -->
    <link class="_dcdev_preset_" rel="icon" href="https://www.dcdev.net/icon.png" type="image/x-icon">
    <link class="_dcdev_preset_" rel="shortcut icon" href="https://www.dcdev.net/icon.png" type="image/x-icon">


</head>

<body>
    <!------ dcdev_body_container不要删除,内容在 body start 及 body end 中间书写  ------>
    <div class="dcdev-body-container" id="dcdev_body_container">
        <!-- body start -->
        <br>
        <div>
            <a id="more" onclick="popup_menu()">标签</a>
            <!-- <button id="more" onclick="popup_menu()">弹出菜单</button> -->
        </div>
        <!-- body end -->
    </div>
</body>

<!------ 以下内容不要变动 --------------------------------------------------------->
<script class="_dcdev_preset_" src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<!-- 不授权模式，仅初始化常用变量及函数 -->
<script class="_dcdev_preset_" src="https://res.dcdev.net/dcdev/v1.0.6/assets/js/init.js" id="initClass"
    authorize_mode="none" console_mode=""></script>
<script class="_dcdev_preset_" src="./popup_menu.js"></script>


<!------ 以上内容不要变动 --------------------------------------------------------->

<script>
    function popup_menu() {
        data = {
            // 弹出菜单的div
            id: `more`,
            // 显示的位置(可以选择left/right/top/bottom)
            position: "left",
            dl_config: {
                style: "top: 20px;width: auto;padding-right:10px;text-align: left;",
            },
            // 菜单项
            dd_config: [{
                    dd_key: "share_code",
                    dd_class: "",
                    dd_style: "display:inline-flex",
                    dd_img: {
                        src: "https://res.dcdev.net/dcdev/v1.0.6/assets/images/share.svg",
                        width: "15px",
                        class: "dcdev-icon-btn",
                        style: "width:25px;height:25px;margin-left:4px;",
                    },
                    dd_text: {
                        text: "分享代码",
                        style: "margin-left:4px;",
                        clss: ""
                    }
                },
                {
                    // 为空则设置为分隔线
                },
                {
                    dd_key: "save",
                    dd_class: "",
                    dd_style: "display:inline-flex",
                    dd_img: {
                        src: "https://res.dcdev.net/dcdev/v1.0.6/assets/images/save.svg",
                        width: "20px",
                        class: "dcdev-icon-btn",
                        style: "",
                    },
                    dd_text: {
                        text: "保存",
                        style: "",
                        clss: ""
                    }
                },
                {
                    dd_key: "save_as",
                    dd_class: "",
                    dd_style: "display:inline-flex",
                    dd_img: {
                        src: "https://res.dcdev.net/dcdev/v1.0.6/assets/images/saveas.svg",
                        width: "20px",
                        class: "dcdev-icon-btn",
                        style: "",
                    },
                    dd_text: {
                        text: "另存为",
                        style: "",
                        clss: ""
                    }
                },
                {
                    // 为空则设置为分隔线
                },
                {
                    dd_key: "get_my_code",
                    dd_class: "",
                    dd_style: "display:inline-flex",
                    dd_img: {
                        src: "https://res.dcdev.net/dcdev/v1.0.6/assets/images/code.svg",
                        width: "20px",
                        class: "dcdev-icon-btn",
                        style: "",
                    },
                    dd_text: {
                        text: "我的代码",
                        style: "",
                        clss: ""
                    }
                },
            ],
            click_cb: function name(params) {

            },
        }

        popup_menu_class.popup_menu(data);
    }
</script>

</html>